// pages/map/map.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    state:1
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function(options) {
    let that = this
    getApp().copyCityId()
    wx.openLocation({
      latitude: Number(options.lat),
      longitude: Number(options.lot),
      scale: 18,
      success:function(){
        console.log(1)
        that.data.state = 2
      }
    })
    
  },
  onShow(){
    console.log(this.data.state)
    if(this.data.state == 2){
      wx.navigateBack()
    }
  },

  onHide: function() {
    console.log(9)
  },
})